package cn.lml.lession.user.service.impl;

import java.util.List;
import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.lml.lession.user.dao.UserRoleMapper;
import cn.lml.lession.user.model.UserRole;
import cn.lml.lession.user.service.UserRoleService;

@Service
public class UserRoleServiceImpl implements UserRoleService{

	private static final Logger logger=LoggerFactory.getLogger(UserRoleServiceImpl.class);	
	@Autowired
	private UserRoleMapper userRoleMapper;

	@Override
	public Integer insertUserRole (UserRole userRole){
		logger.debug("新增数据 "+userRole);
		return userRoleMapper.insertUserRole(userRole);
	}

	@Override
	public Integer deleteByUid (Integer uid){
		logger.debug("通过Uid删除数据 "+uid);
		return userRoleMapper.deleteByUid(uid);
	}

	@Override
	public Integer updateByUid (UserRole userRole){
		logger.debug("通过Uid修改数据 "+userRole);
		return userRoleMapper.updateByUid(userRole);
	}

	@Override
	public UserRole selectByUid (Integer uid){
		logger.debug("通过Uid查找数据 "+uid);
		return userRoleMapper.selectByUid(uid);
	}

	@Override
	public List<UserRole> queryUserRole(Map<String, Object> cond) {
		logger.debug("分页查询数据 "+cond);
		return userRoleMapper.queryUserRole(cond);
	}

	@Override
	public Integer countUserRole(Map<String, Object> cond) {
		logger.debug("统计数据 "+cond);
		return userRoleMapper.countUserRole(cond);
	}

}